<template>
  <div>
    <div>aaaa {{ $route.query.id }}</div>
    <div>bbb{{ $route.params }}</div>
    <input v-model="user" type="text" placeholder="请输入用户名" />
    <input v-model="pwd" type="password" />
    <button @click="login">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: "",
      pwd: "",
    };
  },
  methods: {
    login() {
      if (this.user == "admin" && this.pwd == "123456") {
        this.$router.push("/home");
      } else {
        alert("请输入正确的账号或者密码");
      }
    },
  },
};
</script>

<style>
</style>